﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SliceManage.aspx.cs" Inherits="Business_YiWu_SliceManage" Theme="normal"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>时段管理</title>
    <style type="text/css">
       .buttons
       {
         border:1px solid #C9DEEC; 
         background-color:#FFFFFF; 
         margin-left:0px;
         height:20px;
       } 
        .test
        {
        	
	        height:25px;
	        float:left;
	        padding-left: 65px;
	        padding-top: 5px;
	        color:#2f2f2f;
	        vertical-align: middle;
	        line-height:30px;
        }
    </style>

    <script language="javascript" type="text/javascript">
            function SelectAllCheckboxes(spanChk)
	        {
		        // Added as ASPX uses SPAN for checkbox
		        var xState=spanChk.checked;

		        elm = spanChk.form.elements;
		        for(i = 0; i < elm.length; i++)
		        {
			        if(elm[i].type == "checkbox" && elm[i].id != spanChk.id)
			        {
				        //elm[i].click();
				        if(elm[i].checked!=xState)
					        elm[i].click();	//elm[i].checked=xState;
			        }
		        }
	        }
    </script>

</head>
<body style="background-color: #fcf6ec">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="Scriptmanager1" runat="server" EnableScriptGlobalization="true"
            EnableScriptLocalization="true">
        </asp:ScriptManager>
        <div class="normalnav">
            <div class="normalcontent">
                <span style="color: #ffffff">信息管理>>></span><span style="color: #f6ff00">时段信息管理</span>
            </div>
        </div>
        <!-- 查询框-->
        <div class="normalmenu1long">
            <div class="normalmenucontentlong">
                <asp:CheckBox ID="ChkAll" runat="server" Text="全选" onclick="javascript:SelectAllCheckboxes(this)"
                    Font-Size="small" />&nbsp;&nbsp;
                <%--<asp:ImageButton ID="ibtntuijian" runat="server" ImageUrl="../../Images/Basic/shenpi2.gif"
                    CausesValidation="False" ToolTip="发送短信提醒" OnClick="ibtntuijian_Click" Width="20px"
                    Height="19px" />&nbsp;发送短信提醒&nbsp;--%>
                <asp:ImageButton ID="butDelete" runat="server" ImageUrl="../../Images/Basic/tingyong.gif"
                    OnClick="butDelete_Click" CausesValidation="False" ToolTip="删除" />&nbsp;删除&nbsp;
                <asp:ImageButton ID="ibtnxinzeng" runat="server" ImageUrl="../../Images/Basic/tianjia.gif"
                    CausesValidation="False" ToolTip="新增" OnClick="ibtnxinzeng_Click" />&nbsp;新增&nbsp;
                    <%--<asp:ImageButton ID="ibtnExport" runat="server" ImageUrl="../../Images/Basic/daochuexceljilu.gif"
                    CausesValidation="False" ToolTip="导出Excel记录"/>&nbsp;导出Excel记录--%>
                <%--<asp:ImageButton ID="ibtnputong" runat="server" ImageUrl="../../Images/Basic/zhuanfa.gif"
                    CausesValidation="False" ToolTip="扩展功能1预留" OnClick="ibtnputong_Click" Width="20px"
                    Height="19px" />&nbsp;扩展功能1预留
                <asp:ImageButton ID="ibtnshenpi" runat="server" ImageUrl="../../Images/Basic/shenhe.gif"
                    CausesValidation="False" OnClick="ibtnshenpi_Click" ToolTip="扩展功能2预留" />&nbsp;扩展功能2预留
                <asp:ImageButton ID="ibtnchongzhi" runat="server" ImageUrl="../../Images/Basic/EnterBasicInfo.gif"
                    CausesValidation="False" ToolTip="扩展功能3预留" OnClick="ibtnchongzhi_Click" Width="20px"
                    Height="19px" />&nbsp;扩展功能3预留--%>
                <%--&nbsp;&nbsp;当前医院：--%><asp:Label ID="lblHospitalName" runat="server" Visible="false"></asp:Label>
                                        <asp:Label ID="lblHospitalID" runat="server" Visible="false"></asp:Label>
                <asp:DropDownList ID="DDLTemplate" Width="100px" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="DDLTemplate_SelectedIndexChanged" Visible="false">
                </asp:DropDownList>
                <br />
                <%--预约时间&nbsp;
                <asp:TextBox ID="txtDateA" Width="70px" runat="server" ></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期"/>
                    <ajaxToolkit:CalendarExtender ID="customCalendarExtender" runat="server" TargetControlID="txtDateA"
                        Format="yyyy-MM-dd" PopupButtonID="Image1"/>
                    
                    至：
                    <asp:TextBox ID="txtDateB" Width="70px" runat="server"></asp:TextBox>           
                    <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateB"
                        Format="yyyy-MM-dd" PopupButtonID="Image2" /> 
                        
                    <span style="color: #426F98; font-family: 宋体; font-size: 12px">
                        <asp:Label ID="lbldate" runat="server" Text="正确的日期格式为:YYYY-MM-DD"></asp:Label>     
                    </span>      
                     <!--验证-->
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写开始时间！</span>" ControlToValidate="txtDateA" Display="None"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写结束时间！</span>" ControlToValidate="txtDateB" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>开始日期格式不正确！</span>" ControlToValidate="txtDateA" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>结束日期格式不正确！</span>" ControlToValidate="txtDateB" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
                        TargetControlID="RegularExpressionValidator1" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
                        TargetControlID="RegularExpressionValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server"
                        TargetControlID="RequiredFieldValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server"
                        TargetControlID="RequiredFieldValidator3" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                
                <br />--%>
                查询：所属区域&nbsp;
                     <asp:DropDownList ID="ddl_ParentArea" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl_ParentArea_SelectedIndexChanged">
                        </asp:DropDownList>&nbsp;
                        所属医院&nbsp;<asp:DropDownList ID="ddlHospital" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlHospital_SelectedIndexChanged">
                        </asp:DropDownList>&nbsp;
                        所属科室&nbsp;
                        
                <asp:DropDownList ID="ddlDep" Width="110px" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDep_SelectedIndexChanged">
                          </asp:DropDownList>
                          <br />
                          <%--<asp:DropDownList ID="ddltime" Width="110px" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddltime_SelectedIndexChanged">
                          </asp:DropDownList>--%>
                <%--&nbsp;姓名&nbsp;<asp:TextBox ID="txtPropasalname" runat="server" Font-Size="14px" Width="90px"></asp:TextBox>--%>
                &nbsp;时段名称&nbsp;<asp:TextBox ID="txtPropasal" runat="server" Font-Size="14px" Width="90px"></asp:TextBox>
                <asp:ImageButton ID="ibtnsearch" runat="server" ImageUrl="../../images/Basic/chaxun.gif" OnClick="butlookout_Click"
                    ToolTip="查询" />&nbsp;&nbsp;
                <asp:ImageButton ID="ibtClear" runat="server" CausesValidation="false" ImageUrl="../../images/Basic/qingkong.gif"
                    OnClick="ibtClear_Click" ToolTip="清空" />&nbsp;清空&nbsp;&nbsp;
            </div>
        </div>
        <div class="normalgrid1long">
            <%--列表主题--%>
            <asp:GridView ID="gvitem" runat="server" OnRowCommand="gvitem_RowCommand" OnPageIndexChanging="gvitem_PageIndexChanging"
                OnRowCreated="gvitem_RowCreated" EmptyDataText="暂无" OnRowDataBound="gvitem_RowDataBound"
                SkinID="Normal" Width="100%">
                <Columns>
                    <asp:TemplateField HeaderText="序号" Visible="False" HeaderStyle-Width="30px" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="LblID" Text='<%# DataBinder.Eval(Container.DataItem,"TS_SliceID") %>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="选择" HeaderStyle-Width="60px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="false" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="60px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="时段名称" HeaderStyle-Width="200px"  HeaderStyle-Height="30px">
                        <ItemTemplate>
                            
                                <%--<asp:Label ID="lblHI_HospitalName" runat="server" Text='<%# Cisoft.IntegrationSystem.Common.Function.cutString(DataBinder.Eval(Container.DataItem, "HI_HospitalName").ToString(), 6)%>'
                                    ToolTip='<%# DataBinder.Eval(Container.DataItem, "HI_HospitalName").ToString()%>'></asp:Label>--%>
                           <asp:Label ID="lblTS_SliceName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TS_SliceName").ToString()%>'
                                    ToolTip='<%# DataBinder.Eval(Container.DataItem, "TS_SliceName").ToString()%>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="计划人数" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "TS_SlicePlanNum").ToString()%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="所属科室" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "DI_DepartmentlName").ToString()%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="所属医院" HeaderStyle-Width="150px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "HI_HospitalName").ToString()%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="150px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="所属区域" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "AI_AreaName").ToString()%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                    <%--<asp:TemplateField HeaderText="患者姓名" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <asp:Label ID="lblPI_Name" runat="server" Text='<%# Cisoft.IntegrationSystem.Common.Function.cutString(DataBinder.Eval(Container.DataItem, "PI_Name").ToString(), 4)%>'
                                    ToolTip='<%# DataBinder.Eval(Container.DataItem, "PI_Name").ToString()%>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="性别" HeaderStyle-Width="50px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "PI_Sex")%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="手机号码" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "PI_MobileNum")%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="预约时段" HeaderStyle-Width="180px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <asp:Label ID="lblTS_SliceName" runat="server" Text='<%# Cisoft.IntegrationSystem.Common.Function.cutString(DataBinder.Eval(Container.DataItem, "TS_SliceName").ToString(), 20)%>'
                                    ToolTip='<%# DataBinder.Eval(Container.DataItem, "TS_SliceName").ToString()%>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="200px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="预约日期" HeaderStyle-Width="120px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <asp:Label ID="lblPI_PlanTime" runat="server" Text='<%# Cisoft.IntegrationSystem.Common.Function.cutString(System.Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "PI_PlanTime")).ToString("yyyy年MM月dd日"), 11)%>'
                                    ToolTip='<%# DataBinder.Eval(Container.DataItem, "PI_PlanTime").ToString()%>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="操作" HeaderStyle-Width="100px" HeaderStyle-Height="30px">
                        <ItemTemplate>
                            <a href='SliceEdit.aspx?id=<%#Eval("TS_SliceID") %>'>修改</a>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:TemplateField>
                   
                    
                </Columns>
            </asp:GridView>
        </div>
        <div class="normalpager1" style="position: absolute; top: 415px; left: 300px;">
            <div runat="server" id="PageDiv" visible="false">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td style="height: 25px">
                            <asp:ImageButton ID="ibtnPreviousPage" runat="server" ImageUrl="../Images/arrow_left.gif"
                                OnClick="PagerButtonClick" CommandArgument="prev" Visible="false" />
                            <asp:Label ID="lbCurrentIndex" runat="server" meta:resourcekey="lbCurrentIndexResource1"
                                Visible="false"></asp:Label><%--/--%><asp:Label ID="lbPageCount" runat="server" meta:resourcekey="lbPageCountResource1"
                                    Visible="false"></asp:Label>&nbsp;<%--共--%><asp:Label ID="lbSum" runat="server" ForeColor="Red"
                                        meta:resourcekey="lbSumResource1" Visible="false"></asp:Label><%--条--%>
                            <asp:ImageButton ID="ibtnNextPage" runat="server" ImageUrl="../Images/arrow_right.gif"
                                OnClick="PagerButtonClick" CommandArgument="next" Visible="false" />
                            <asp:Label ID="lblNumbers" runat="server"></asp:Label>&nbsp;&nbsp;
                            <asp:LinkButton ID="btnFirst" OnClick="PagerButtonClick" runat="server" CommandArgument="0"
                                CausesValidation="False">最首页</asp:LinkButton>&nbsp;
                            <asp:LinkButton ID="btnPrev" OnClick="PagerButtonClick" runat="server" CommandArgument="prev"
                                CausesValidation="False">前一页</asp:LinkButton>&nbsp;
                            <asp:Label ID="lblCurrentIndex" runat="server"></asp:Label>&nbsp;/&nbsp;
                            <asp:Label ID="lblPageCount" runat="server"></asp:Label>
                            <asp:LinkButton ID="btnNext" OnClick="PagerButtonClick" runat="server" CommandArgument="next"
                                CausesValidation="False">后一页</asp:LinkButton>&nbsp;
                            <asp:LinkButton ID="btnLast" OnClick="PagerButtonClick" runat="server" CommandArgument="last"
                                CausesValidation="False">最后页</asp:LinkButton>
                            &nbsp;跳到第<asp:TextBox ID="txtPageGo" runat="server" CssClass="txt" Height="17px"
                                Width="29px"></asp:TextBox>页
                            <asp:Button ID="btnPageGo" BorderStyle="none" BackColor="#E1EFFC" OnClick="btnPageGo_Click"
                                runat="server" CssClass="btn13" Text="Go" /></td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>
